<template>
  <Index />
  <div class="container">
    <div class="content">
      <div class="succss-img">
        <img src="../../assets/img/success.png" alt="" />
        <span>支付成功</span>
      </div>

      <div class="order-desc">
        <div class="order">
          <span>北京</span>
          <img src="../../assets/img/air2.png" alt="" />
          <span>广州</span>
        </div>
        <div>
          <span>2024年1月25日 南航 CZ3210 22:00 ~ 00:50,机票已购买成功</span>
        </div>
      </div>

      <div class="discounts">
        <div class="desc">
          <div class="desc-content">
            <div class="left">
              <span>AI帮您省了</span>
            </div>
            <div class="right">
              <span>100元</span>
            </div>
          </div>
        </div>
      </div>

      <div class="query-btn-container">
        <div @click="queryOrder">
          <span>查看订单</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import mitter from "@/utils/mitter.js";

function queryOrder() {
  mitter.emit("queryOrder");
}
</script>
<style scoped lang="scss">
.container {
  width: 80vw;
  height: 70vh;
  position: absolute;
  top: 55%;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;

  .content {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    .succss-img {
      display: flex;
      flex-direction: column;
      align-items: center;
      & > :nth-child(1) {
        width: 149px;
        height: 145px;
      }
      & > :nth-child(2) {
        font-family: PingFangSC, PingFang SC;
        font-weight: 600;
        font-size: 30px;
        color: #000000;
        line-height: 36px;
        text-align: left;
        font-style: normal;
      }
    }
    .order-desc {
      display: flex;
      align-items: center;
      margin-top: 10px;
      .order {
        display: flex;
        align-items: center;
        & > :nth-child(1) {
          font-family: PingFangSC, PingFang SC;
          font-weight: 400;
          font-size: 16px;
          color: #005ff9;
          line-height: 16px;
          text-align: left;
          font-style: normal;
        }
        & > :nth-child(2) {
          width: 20px;
          height: 20px;
          margin: 0 10px;
        }
        & > :nth-child(3) {
          font-family: PingFangSC, PingFang SC;
          font-weight: 400;
          font-size: 16px;
          color: #005ff9;
          line-height: 16px;
          text-align: left;
          font-style: normal;
        }
      }

      .order ~ div {
        margin-left: 10px;
        span {
          font-family: PingFangSC, PingFang SC;
          font-weight: 400;
          font-size: 16px;
          color: #434343;
          line-height: 16px;
          text-align: center;
          font-style: normal;
        }
      }
    }

    .discounts {
      display: flex;
      justify-content: center;
      margin-top: 10px;
      .desc {
        width: 107px;
        height: 21px;
        border-radius: 3px;
        border: 1px solid #f23232;
        // margin-left: 10px;

        .desc-content {
          display: flex;
          align-items: center;

          .right {
            width: 55px;
            height: 21px;
            background: #f23232;
            border-radius: 3px;
            display: flex;
            align-items: center;
            justify-content: center;

            span {
              font-family: PingFangSC, PingFang SC;
              font-weight: 400;
              font-size: 14px;
              color: #ffffff;
              line-height: 11px;
              text-align: left;
              font-style: normal;
              // width: 55px;
            }
          }
          .left {
            height: 21px;
            background: rgba(242, 50, 50, 0.08);
            border-radius: 3px;
            //   border: 1px solid #f23232;
            display: flex;
            align-items: center;
            justify-content: center;

            span {
              font-family: PingFangSC, PingFang SC;
              font-weight: 400;
              font-size: 11px;
              color: #f23232;
              line-height: 11px;
              text-align: left;
              font-style: normal;
              width: 57px;
              margin-left: 3px;
            }
          }
        }
      }
    }

    .query-btn-container {
      display: flex;
      justify-content: center;
      margin-top: 10%;
      & > :nth-child(1) {
        width: 212px;
        height: 54px;
        background: #ffffff;
        box-shadow: 0px 2px 6px 0px rgba(205, 207, 210, 0.27);
        border-radius: 33px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;

        &:hover {
          transform: scale(1.01);
          box-shadow: 0 0px 5px 0 rgba(0, 0, 0, 0.05);
        }
        span {
          width: 72px;
          height: 18px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          font-size: 18px;
          color: #000000;
          line-height: 18px;
          text-align: center;
          font-style: normal;
        }
      }
    }
  }
}
</style>
